import dataclasses
from typing import Optional

import coin.proto.coin_data_replay_pb2 as cdr_pb2


@dataclasses.dataclass
class RawData:
  timestamp: int
  value: bytes


@dataclasses.dataclass
class TopicData:
  topic_data_info: cdr_pb2.TopicDataInfo
  topic_data_value: RawData


class IRawDataReader(object):
  def read(self) -> Optional[RawData]:
    raise NotImplementedError()

  def peek(self) -> Optional[RawData]:
    raise NotImplementedError()


class ITopicDataReader(object):
  @property
  def topic_data_info(self) -> cdr_pb2.TopicDataInfo:
    raise NotImplementedError()

  def read(self) -> Optional[TopicData]:
    raise NotImplementedError()

  def peek(self) -> Optional[TopicData]:
    raise NotImplementedError()
